<?php
/*****************************************************************************
*
*	copyright(c) - sitemile.com - PricerrTheme
*	More Info: http://sitemile.com/p/pricerr
*	Coder: Saioc Dragos Andrei
*	Email: andreisaioc@gmail.com
*
******************************************************************************/


?>

	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes('xhtml'); ?> >
	<head>

	<title>
	<?php
		global $page, $paged;
		wp_title( '|', true, 'right' );

		bloginfo( 'name' );	

		$site_description = get_bloginfo( 'description', 'display' );
		if ( $site_description && ( is_home() || is_front_page() ) )
			echo " | $site_description";	

		if ( $paged >= 2 || $page >= 2 )
			echo ' | ' . sprintf( __( 'Page %s', 'PricerrTheme' ), max( $paged, $page ) );
	?>
    </title>
	<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
	<?php wp_enqueue_script("jquery"); ?>

	<?php wp_head(); ?>	 

    <?php do_action('PricerrTheme_before_head_tag_open'); ?>
		
	<script type="text/javascript" src="<?php echo get_bloginfo('template_url'); ?>/js/my-script.js"></script>  
    <script type="text/javascript">
	function suggest(inputString){
	
		if(inputString.length == 0) {
			$('#suggestions').fadeOut();
		} else {
		$('#big-search').addClass('load');
			$.post("<?php bloginfo('siteurl'); ?>/?autosuggest=1", {queryString: ""+inputString+""}, function(data){
				if(data.length >0) {
					$('#suggestions').fadeIn();
					$('#suggestionsList').html(data);
					$('#big-search').removeClass('load');
				}
			});
		}
	}

	function fill(thisValue) {
		$('#big-search').val(thisValue);
		setTimeout("$('#suggestions').fadeOut();", 600);
	}

	</script>
     <?php
	 	
		$PricerrTheme_color_for_footer = get_option('PricerrTheme_color_for_footer');
		if(!empty($PricerrTheme_color_for_footer))
		{
			echo '<style> #footer { background:#'.$PricerrTheme_color_for_footer.' }</style>';	
		}
		
		
		$PricerrTheme_color_for_bk = get_option('PricerrTheme_color_for_bk');
		if(!empty($PricerrTheme_color_for_bk))
		{
			echo '<style> body { background:#'.$PricerrTheme_color_for_bk.' }</style>';	
		}
		
		$PricerrTheme_color_for_top_links = get_option('PricerrTheme_color_for_top_links');
		if(!empty($PricerrTheme_color_for_top_links))
		{
			echo '<style> .top-links { background:#'.$PricerrTheme_color_for_top_links.' }</style>';	
		}
		
		
		//----------------------
		
	 	$PricerrTheme_home_page_layout = get_option('PricerrTheme_home_page_layout');
		if(is_home()):
			if($PricerrTheme_home_page_layout == "4"):
				echo '<style>#content { float:right } #right-sidebar { float:left; }</style>';
			endif;
			
			if($PricerrTheme_home_page_layout == "5"):
				echo '<style>#content { width:100%; } .main-how-it-works{ width:100% }</style>';
			endif;
			
			if($PricerrTheme_home_page_layout == "3"):
				echo '<style>#content { width:520px } .title_holder { width:385px; } #left-sidebar{	margin-right:15px;}
				.main-how-it-works { width:520px; } .i_will_mainbox{ width:240px } .how-does-it-work-btn { top:30% }</style>';
			endif;
			
			
			if($PricerrTheme_home_page_layout == "2"):
				echo '<style>#content { width:520px } #left-sidebar{ float:right } #left-sidebar{ margin-right:15px; } .title_holder { width:385px; }
				.main-how-it-works { width:520px; } .i_will_mainbox{ width:240px } .how-does-it-work-btn { top:30% }</style>';
			endif;
		
		endif;
	 
	 
	 ?>
     
     <!-- ########################################## -->
     
	</head>
	<body <?php body_class(); ?> >
    <div id="my_container">
    
     <div class="main_links">
        <div class="top-links">
						    
							<?php 
								if(is_user_logged_in())
								{
									global $current_user;
									get_currentuserinfo();
									echo '<a href="'.PricerrTheme_my_account_link().'">';
									echo sprintf(__('Welcome, %s', 'PricerrTheme'), $current_user->user_login );
									echo '</a>';
								
								
								}
								
								if(current_user_can('manage_options')) {?> <a href="<?php bloginfo('siteurl'); ?>/wp-admin"><?php echo __("Wp-Admin"); ?></a> <?php }
							
							?>
							
							<a href="<?php bloginfo('siteurl') ?>"><?php echo __("Home","PricerrTheme"); ?></a> 
							<a href="<?php echo PricerrTheme_post_new_link(); ?>"><?php echo __("Post New","PricerrTheme"); ?></a> 
							<?php if(get_option('PricerrTheme_enable_blog') != "no") { ?>
                            <a href="<?php echo PricerrTheme_blog_link(); ?>"><?php echo __("Blog","PricerrTheme"); ?></a> 
							<?php } ?>
					
                    
                    
                    <?php
							
							$menu_name = 'Pricerr_top_menu_header';

							if ( ( $locations = get_nav_menu_locations() ) && isset( $locations[ $menu_name ] ) ) {
							$menu = wp_get_nav_menu_object( $locations[ $menu_name ] );
						
							$menu_items = wp_get_nav_menu_items($menu->term_id);
					
						
							foreach ( (array) $menu_items as $key => $menu_item ) {
								$title = $menu_item->title;
								$url = $menu_item->url;
								if(!empty($title))
								echo '<a href="' . $url . '">' . $title . '</a> ';
							}
								
							}
							
							
							?>
                    
                    
                    
                    		<?php
					
								if(is_user_logged_in())
								{
									?>
									
									<a href="<?php echo PricerrTheme_my_account_link(); ?>"><?php echo __("MyAccount","PricerrTheme"); ?></a>
							<a href="<?php echo wp_logout_url(); ?>"><?php echo __("Log Out","PricerrTheme"); ?></a>
									
									<?php
								}
								else
									{
										
							
							?>
							
							<a href="<?php bloginfo('siteurl') ?>/wp-login.php?action=register"><?php echo __("Register","PricerrTheme"); ?></a>
							<a href="<?php bloginfo('siteurl') ?>/wp-login.php"><?php echo __("Log In","PricerrTheme"); ?></a>
							<?php } ?>
						</div>
        </div>
        
		<div id="header">	
            
            
			<div class="middle-header-bg">
				<div class="middle-header" id="middle-header-id">
						
						
                <!-- SpW: deleted displaying the logo in the header.php -->
                
                
                
                
                
                <!-- #############################--> 
                </div>
				
			</div> <!-- middle-header-bg -->
			

			
		</div>	
        
    
    
    	<div id="main">